home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / comm / cnet / cnet_wof.lha / wof.lha / support.lha / Grow < prev    next >
Text File  |  1997-04-17  |  3KB  |  35 lines

  1. /**************************************************************************\
  2.           $VER: WOF Grow, v6.51 (17-Apr-97) by Dotoran of Frontiers!
  3. \**************************************************************************/
  4. options results;signal on SYNTAX;signal on ERROR;signal on IOERR
  5. a=sourceline(2);parse var a . ", "ver" ("vdate")" .
  6. tr=transmit;se=sendstring;gc=getchar;gu=getuser;gs=getscratch;mg=maygetchar
  7. parse source . . fp .;df=left(fp,max(lastpos('/',fp),lastpos(':',fp)))
  8. dfile=df;call open(f1,dfile"NewPuz","R");do i=1 until eof(f1);p.i=readln(f1);end i;call close(f1)
  9. tot=i-1;c=1;nc=0;z="00"x;changewhere "WOF Puz. Grower";tr "f1"
  10. START:;tr "f0n3caGrow cbPuzData c6File, cfv1.10n1";tr "c6Puzzle cf"c" c6of cb"tot" c6total puzzlesc9; ca"nc" cbSavedc6.n1"
  11.   if c>tot then signal QUIT;else parse var p.c puz"|"clu"|"aut"|"j;tr "caPc9:cauzzlec9>z4cb "left(puz,50)" z0"
  12.   tr "ceCc9:celue  c9>z4cb "left(clu,20)" z0";tr "caAc9:cauthorc9>z4cb "left(aut,20)" z0n1"
  13.   tr "cbSc9:cbave   c6this puzzle. (Add to end of PuzData file)";tr "c9Dc1:c9elete c7this puzzle. (Do not add to PuzData file)"
  14.   tr "cdQc9:cduit   c6for now.     (Ask me again the next time)"
  15. MENU:;se "1Hcf>>>-caPcf,ceCcf,caAcf,cbScf,c9Dcf,cdQcf--> ";gc;a=result
  16.   if index("PCADS",a)=0 then a="Q";if a="Q" then do;tr "cdQuitc6!";signal QUIT;end;if a="D" then do;tr "c9Deletec6!";c=c+1;signal START;end
  17.   if a="P" then do;tr "caPuzzle";se "0Hz4cfL1305640 #"puz"}i5 50}z0";gu 70;a=result;if a="" then a=puz;puz=a;tr "0Hz4cb"left(puz,50)"z0";signal MENU;end
  18.   if a="C" then do;tr "ceClue";se "0Hz4cfL1305640 #"clu"}i5 20}z0";gu 70;a=result;if a="" then a=clu;clu=a;tr "0Hz4cb"left(clu,20)"z0";signal MENU;end
  19.   if a="A" then do;tr "caAuthor";se "10Hz4cfL1305640 #"aut"}i20 20}z0";gu 70;a=result;if a="" then a=aut;aut=a;tr "10Hz4cb"left(aut,20)"z0";signal MENU;end
  20.   if a="S" then do;tr "cbSave";nc=nc+1;np.nc=left(puz,50,z)left(clu,20,z)left(aut,20,z);c=c+1;signal START;end
  21. QUIT:se "1H";if c>tot then do;se "c9Deleting cf`cdNewPuzcf' c6file...";address command "delete "dfile"NewPuz";tr "cdDonec6!";end
  22.   if c<=tot then do;se "caUpdating cf`cdNewPuzcf' c6file...";call open(f1,dfile"NewPuz","W")
  23.   do i=c to tot;call writeln(f1,p.i);end i;call close(f1);tr "cdDonec6!";end;if nc=0 then do;tr "c9No Puzzles to Add";exit;end
  24.   call open(f1,dfile"PuzData","R");totp=strip(readch(f1,5),"t",z);call close(f1);se "n1caAdding cb"nc" c6puzzlesc9: c7[ce000c7]ce<1"
  25.   call open(f1,dfile"PuzData","A");call seek(f1,0,"b");call writech(f1,left(totp+nc,5,z));call seek(f1,0,"e")
  26.   do i=1 to nc;np.i=translate(np.i,reverse(xrange("!","~")),xrange("!","~"));call writech(f1,np.i);se "<3"right(i,3,'0');end i
  27.   call close(f1);tr ">2cdDonec6!";exit
  28. SYNTAX:;ERROR:;IOERR:;e1="n1 Error: "rc" ("errortext(rc)")"
  29.   e2="  Line: "left(sigl,4)"File:";c="`"fp", "ver"'";e2=e2" "c;tr e1;tr e2
  30.   logentry e1;logentry e2;e=strip(translate(sourceline(sigl),"\{",""))
  31.   do while e~="";e3="Source: "left(e,37);tr e3;logentry e3;e=substr(e,38);end
  32.   bufferflush
  33. /**************************************************************************\
  34. \****************************************** Frontiers BBS (716)/823-9892 **/
  35.